module Sustainalytics.Portfolio {
    import Common = Sustainalytics.Common;
    import SearchBox = Sustainalytics.SearchBox;
    export class SystemPortfolioSearchBoxServiceAdapter implements IPortfolioSearchBoxService {

        private portfolioSearchService: PortfolioSearchService;

        public constructor($http: ng.IHttpService, $rootScope: ng.IScope, $q: ng.IQService) {

            this.portfolioSearchService = new Sustainalytics.Portfolio.PortfolioSearchService($http, $rootScope, $q);
        }

        public Search(searchData: any, skip: number, take: number): ng.IHttpPromise<any[]> {
            var lstPromise: ng.IHttpPromise<PortfolioDto[]> = this.portfolioSearchService.SearchPortfolio(searchData, skip, take,PortfolioTypes.System,PortfolioSharingStatus.Private);
            return lstPromise;
        }
    }
    var portfolioSearchModule = angular.module(portfolioModuleName);

    portfolioSearchModule.service('SystemPortfolioSearchBoxServiceAdapter',
        ['$http', '$rootScope', '$q', SystemPortfolioSearchBoxServiceAdapter]);
}